package org.jwcloud.project.module.zx.common;

import java.util.HashMap;
import java.util.stream.Stream;

import org.jwcloud.project.module.zx.common.repository.RptCommonRepository;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;



/**
 * mysql定时任务被干掉了，用java
 * @author song
 *
 */

@Order(10)
@Component
public class NbSqlFactory {

//	private static Logger logger = Logger.getLogger(MysqlScheduled.class);
	
    @Autowired
    private ApplicationContext applicationContext;
    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;
	
    public void run() throws Exception {
        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        //sqlSessionFactory
        //sqlSessionTemplate
        //SqlSessionTemplate aa = (SqlSessionTemplate) applicationContext.getBean("sqlSessionTemplate");
        
        System.out.println(sqlSessionTemplate.selectList("org.jwcloud.project.module.zx.txzldp.service.repository.TxzldpDoorRepository.queryDoorProject", new HashMap()));
        
//        System.out.println("bean 总数：" + beanDefinitionNames.length);
//        for(String beanName: beanDefinitionNames) {
//        	System.out.println("beanName : " +  beanName);
//            Object bean = applicationContext.getBean(beanName);
//            System.out.println("Spring bean : " +  bean);
//        }

    }
}
